<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

<div id="app">
    <h1>总分数: {{totalScore}}</h1>
</div>

<script src="../js/vue.js"></script>

<script>
    const app = Vue.createApp({
        data() {
            return {
                 members: [
                     {id:1, name:'wx',score:88},
                     {id:2, name:'hh',score:66},
                     {id:3, name:'yy',score:77},
                     {id:4, name:'ly',score:50},
                 ]
             }
        },
        computed:{
            totalScore(){
                return this.members.reduce((a,b) => a += b.score ,0)
            }
        }
    }).mount("#app");
</script>

</body>
</html>